/**
 * Created by Administrator on 2017/4/6.
 */
import {Component} from "@angular/core";
import {User} from "../../shared/user/user";
import {Uservice} from "../../shared/user/user.service";
import {Router} from "@angular/router";

import "rxjs/add/operator/do";
import "rxjs/add/operator/map";
@Component({
    selector: "login",
    templateUrl: "page/login/login.html",
    providers: [Uservice]
})

export class LoginComponent {
    user: User;

    constructor(private router: Router, private userService: Uservice) {
        this.user = new User();
    }

    login() {

        this.userService.login(this.user).subscribe(data => console.log(data),err => console.log(err),() => console.log('Register Complete'));
        console.log(333333333);
    }

    register() {
        this.userService.register()
    }

}
